<?php
$id = empty($_GET['id']) ? 0 : intval($_GET['id']);
$prototypeid = empty($_GET['prototypeid']) ? 0 : intval($_GET['prototypeid']);
if($id == 0 || $prototypeid == 0){
	exit('');
}
$oGoodscat = new Goodscat();
$category_info = $oGoodscat->get_row($id, 'spec');
$category_info['spec'] = @unserialize($category_info['spec']);	// 规格

// 属性/规格
$prototypes = Prototype::get_prototypes();
$spec = $prototypes[$prototypeid];
if(is_array($spec['value'])){
	$row['item'] = isset($category_info['spec'][$prototypeid]) ? $category_info['spec'][$prototypeid] : array();
	$input = make_checkbox_group("spec_item[{$prototypeid}]", $spec['value'], $row['item'], true);
}else{
	$row['item'] = isset($category_info['spec'][$prototypeid]) ? $category_info['spec'][$prototypeid] : '';
	$input = '<input type="text" name="spec_item['.$prototypeid.']" value="'.(trim($row['item'])).'" class="input" style="width:160px;" />';
}
echo $input;
exit;
?>